package com.ruoyi.kaifa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.kaifa.utils.SnowFlakeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kaifa.mapper.AStandingMapper;
import com.ruoyi.kaifa.domain.AStanding;
import com.ruoyi.kaifa.service.IAStandingService;

/**
 * 身份信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-01
 */
@Service
public class AStandingServiceImpl implements IAStandingService 
{
    @Autowired
    private AStandingMapper aStandingMapper;

    /**
     * 查询身份信息
     * 
     * @param id 身份信息主键
     * @return 身份信息
     */
    @Override
    public AStanding selectAStandingById(Long id)
    {
        return aStandingMapper.selectAStandingById(id);
    }

    /**
     * 查询身份信息列表
     * 
     * @param aStanding 身份信息
     * @return 身份信息
     */
    @Override
    public List<AStanding> selectAStandingList(AStanding aStanding)
    {
        return aStandingMapper.selectAStandingList(aStanding);
    }

    /**
     * 新增身份信息
     * 
     * @param aStanding 身份信息
     * @return 结果
     */
    @Override
    public int insertAStanding(AStanding aStanding)
    {
        aStanding.setId(SnowFlakeUtil.getFlowIdInstance().nextId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        System.out.println(aStanding.getId());
        aStanding.setCreateTime(DateUtils.getNowDate());
        return aStandingMapper.insertAStanding(aStanding);
    }

    /**
     * 修改身份信息
     * 
     * @param aStanding 身份信息
     * @return 结果
     */
    @Override
    public int updateAStanding(AStanding aStanding)
    {
        aStanding.setUpdateTime(DateUtils.getNowDate());
        return aStandingMapper.updateAStanding(aStanding);
    }

    /**
     * 批量删除身份信息
     * 
     * @param ids 需要删除的身份信息主键
     * @return 结果
     */
    @Override
    public int deleteAStandingByIds(Long[] ids)
    {
        return aStandingMapper.deleteAStandingByIds(ids);
    }

    /**
     * 删除身份信息信息
     * 
     * @param id 身份信息主键
     * @return 结果
     */
    @Override
    public int deleteAStandingById(Long id)
    {
        return aStandingMapper.deleteAStandingById(id);
    }

    /**
     * 根据名称查询身份信息
     *
     * @param name 名称
     * @return 结果
     */
    @Override
    public List<AStanding> getAStandingList(String name) {
        return aStandingMapper.getAStandingList(name);
    }
}
